import { Component, FC } from "react"
import Context from '../util'
interface Iprops {
  store:any
}
interface Istate {
  
}
class Provider extends Component<Iprops,Istate> {
  componentDidMount(){
    this.props.store.subscribe(()=>{
      this.setState({})
    })
  }
  onNum(){

  }
  render(){
    return (
      <Context.Provider value={{store:{...this.props.store.getState()},dispatch:this.props.store.dispatch,onNum:this.onNum}}>
        {
          this.props.children
        }
      </Context.Provider>      
    )

  }
}

export default Provider
